<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>DIF_DISABLE</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../../styles/styles.css">
<script language="javascript" src='../../links.js' type="text/javascript"></script>
</head>
<body>

<h1>DIF_DISABLE</h1>
<div class=navbar>
<a href="../../index.html">main</a> |
<a href="../index.html">Dialog API</a> |
<a href="index.html">Dialog item flags</a><br>
</div>

<div class=shortdescr>
<p>The <dfn>DIF_DISABLE</dfn> flag directs the Dialog Manager to disable this item. It means that
such dialog element will not receive input focus and will not respond to mouse, but at the same
time a control with this flag set can be changed programmatically.
</div>

<h3>Controls</h3>
<div class=descr>
<p>The <dfn>DIF_DISABLE</dfn> flag is applicable to the following dialog items:<br>
<table width="54%" class="cont">
<tr class="cont"><th class="cont" width="40%">Control</th><th class="cont" width="60%">Description</th></tr>
<tr class="cont">
  <td class="cont" width="40%">All</td>
  <td class="cont" width="60%">All dialog items can be disabled.</td>
</tr>
</table>
</div>


<h3>Remarks</h3>
<div class=descr>
<ol>
<li>To change Enabled/Disabled state of a control, send the
<a href="../dmsg/dm_enable.html">DM_ENABLE</a> message to the Dialog Manager (using the
<a href="../senddlgmessage.html">SendDlgMessage</a> function).
<li>Disabled edit controls are displayed using the <a
href="../../defs/farcolors.html#COL_DIALOGEDITDISABLED">COL_DIALOGEDITDISABLED</a> color. If you
want to change the color of a control, you must add the following code to the dialog handler:
  <pre class=code>
...
if(msg == DN_CTLCOLORDLGITEM)
{
  if(Param1 &gt;= 9 &amp;&amp; Param1 &lt;= 13)
  {
    int Lo=(int)Info.AdvControl(Info.ModuleNumber,ACTL_GETCOLOR,(void*)COL_DIALOGEDIT);
    int Hi=(int)Info.AdvControl(Info.ModuleNumber,ACTL_GETCOLOR,(void*)COL_DIALOGEDITSELECTED);
    return (LONG_PTR)MAKELONG(MAKEWORD(Lo,Hi),MAKEWORD(Lo,Hi));
  }
}
...
</pre>
In this example, predefined colors for disabled items are modified to match colors corresponding to
the normal state of the edit control.
</ol>
</div>

<div class=see>See also:</div><div class=seecont>
</div>

</body>
</html>
